package visitor;

public class VisitorPattern {

    public static void main(String[] args) {
        ComputerPart computer = new Computer();
        computer.add(new Keyboard());
        computer.add(new Mouse());
        computer.add(new Monitor());

        Visitor visitor = new ComputerPartVisitor();
        computer.accept(visitor);
    }
}
